/**
 *
 * Access (ABM), 2017-2020, 单创.
 */
package com.tengju.bff.interfaces.covercharge.service.message.code;

import java.util.Arrays;

/**
 *
 * @author WenLei 2020年3月19日.
 */
public enum TypeChannelEnum {
    
    ABM_GONGGAO_DC_NOTICE("1", 3),
    PROVIDER_SECRET_MESSAGE("2", 4),
    DISCOUNT("3", 1),
    ORDER_LOGISTICS("4", 17),
    CULTIVATE_MESSAGE("5", 3),
    SECRET_MESSAGE("6", 4),
    NEW_FUNCTIONS_INTRODUCTION("7", 3),
    DT_NOTICE("8", 5);

    private String type;
    private int typeCode;

    private TypeChannelEnum(String type, int typeCode) {
        this.type = type;
        this.typeCode = typeCode;
    }

    public String getType() {
        return type;
    }

    public int getTypeCode() {
        return typeCode;
    }

    public static TypeChannelEnum getByType(String type) {
        return Arrays.stream(TypeChannelEnum.values()).filter(k->k.getType().equals(type))
        .findFirst().orElse(null);
    }

}
